#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
ll n, a, b;
vector<int> nums;
vector<int> add;
vector<int> sub;
ll res = 0;
ll get(vector<int> num) {
    ll ans = 0;
    int sz = num.size();
    for (int i = sz - 1; i >= 0; i--) ans = ans * 10 + num[i];
    return ans;
}
void dfs(vector<int> num, int A, int B, int pos)
{
    if (pos < 0) {
        res = max(res, get(num));
        return;
    }
    if (A == 0) {
        if (sub[pos] > B) {
            dfs(num, A, B, pos - 1);
        }
        else {
            num[pos] = 9;
            dfs(num, A, B - sub[pos], pos - 1);
        }
    }
    else {
        int k = num[pos];
        int t = min(A, add[pos]);
        num[pos] += t;
        dfs(num, A - t, B, pos - 1);
        num[pos] = k;
        t = sub[pos] <= B ? sub[pos] : 0;
        num[pos] = (num[pos] - t + 10) % 10;
        dfs(num, A, B - t, pos - 1);
        num[pos] = k;
    }
}
int main()
{
    cin >> n >> a >> b;
    while (n) {
        nums.push_back(n % 10);
        n /= 10;
    }
    n = nums.size();
    add.resize(n);
    sub.resize(n);
    for (int i = n - 1; i >= 0; i--) {
        int num = nums[i];
        add[i] = 9 - num;
        sub[i] = num + 1;
    }
    dfs(nums, a, b, n - 1);
    cout << res << endl;
    return 0;
}